<script>
export default {
  onLaunch: function () {
    console.log("App Launch");
    if (this.$store.state.userType === '1') {
      wx.setTabBarItem({
        index: 0,
        text: "首页",
        iconPath: "static/images/recruit/company-sele(1).png",
        selectedIconPath: "static/images/recruit/company-sele.png",
      });
      wx.setTabBarItem({
        index: 1,
        text: "岗位",
        iconPath: "static/images/recruit/company-sele(3).png",
        selectedIconPath: "static/images/recruit/company-sele(2).png",
      });
      wx.setTabBarItem({
        index: 2,
        text: "消息",
        iconPath: "static/images/recruit/company-sele(5).png",
        selectedIconPath: "static/images/recruit/company-sele(4).png",
      });
      wx.setTabBarItem({
        index: 3,
        text: "我的",
        iconPath: "static/images/recruit/company-sele(9).png",
        selectedIconPath: "static/images/recruit/company-sele(8).png",
      });
    } else {
      wx.setTabBarItem({
        index: 0,
        text: "首页",
        iconPath: "static/images/recruit/company-sele(1).png",
        selectedIconPath: "static/images/recruit/company-sele.png",
      });
      wx.setTabBarItem({
        index: 1,
        text: "人才",
        iconPath: "static/images/recruit/company-sele(7).png",
        selectedIconPath: "static/images/recruit/company-sele(6).png",
      });
      wx.setTabBarItem({
        index: 2,
        text: "岗位",
        iconPath: "static/images/recruit/company-sele(3).png",
        selectedIconPath: "static/images/recruit/company-sele(2).png",
      });
      wx.setTabBarItem({
        index: 3,
        text: "我的",
        iconPath: "static/images/recruit/company-sele(9).png",
        selectedIconPath: "static/images/recruit/company-sele(8).png",
      });
    }

    // const tabItems = [
    //   {
    //     index: 0,
    //     text: "首页",
    //     iconPath: "static/images/recruit/company-sele(1).png",
    //     selectedIconPath: "static/images/recruit/company-sele.png",
    //   },
    //   {
    //     index: 1,
    //     text: "岗位",
    //     iconPath: "static/images/recruit/company-sele(3).png",
    //     selectedIconPath: "static/images/recruit/company-sele(2).png",
    //   },
    //   {
    //     index: 2,
    //     text: "消息",
    //     iconPath: "static/images/recruit/company-sele(5).png",
    //     selectedIconPath: "static/images/recruit/company-sele(4).png",
    //   },
    //   {
    //     index: 3,
    //     text: "我的",
    //     iconPath: "static/images/recruit/company-sele(9).png",
    //     selectedIconPath: "static/images/recruit/company-sele(8).png",
    //   },
    // ];

    // for (let i = 0; i < tabItems.length; i++) {
    //   const item = tabItems[i];
    //   wx.setTabBarItem({
    //     index: item.index,
    //     text: item.text,
    //     iconPath: item.iconPath,
    //     selectedIconPath: item.selectedIconPath,
    //   });
    // }
  },
  onShow: function () {
    console.log("App Show");
  },
  onHide: function () {
    console.log("App Hide");
  },
  onShareAppMessage(res) {
    console.log(res);
  },
  globalData: {
    text: "text",
  },
};
</script>
<style lang="scss">
/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
// @import "uview-ui/index.scss";
</style>
<style lang="scss">
// 全局去除滚动条
::-webkit-scrollbar {
  width: 0;
  height: 0;
  background-color: transparent;
}

scroll-view {
  box-sizing: border-box;
}

page {
  min-height: 100vh;
  background-color: #f8f8f8;
}

.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-center {
  justify-content: center !important;
}

.flex-column {
  flex-direction: column;
}

.flex-grow-1 {
  flex-grow: 1;
}

.flex-wrap {
  flex-wrap: wrap;
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  word-break: break-all;
}

.ellipsis1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-list {
  padding-top: 14rpx;
  font-size: 26rpx;

  .price {
    color: #fc0e4b;
    padding-left: 10rpx;
    margin-right: 12rpx;
  }

  .oldPrice {
    text-decoration: line-through;
    color: #acacac;
  }
}
</style>
